
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>Home</title>
        <!-- CSS --> 
        <link rel="stylesheet" href="ressorces/default.css" type="text/css" media="screen, projection, tv"/>
        <link rel="stylesheet" href="ressorces/print.css" type="text/css" media="print"/>
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
        <script src="ressorces/jquery.tmp.js" type="text/javascript"></script>
        <style>
           
        </style>
        <script type="text/javascript" src="ressorces/utils.js"></script>
        <!-- Favicon -->
        <script type="text/javascript">
            $(document).ready(function() {
                var id = $.urlParam('id');
                var postId = $.urlParam('postID');
                if (postId != 0) {
                    $("div.col-r-in").empty();
                    $.ajax({
                        url: "postService",
                        contentType: "application/json",
                        type: "get",
                        data: "postID=" + postId,
                        success: function(res) {
                            $('title').text(res.data.name);
                            $("div.col-r-in").html("<h2>" + res.data.name + "</h2><br><p>" + res.data.content + "</p><div id='footer_content'><div>");
                        }
                    });
                }
                console.log(id);
                $.ajax({
                    url: "cateDetail",
                    contentType: "application/json",
                    type: "get",
                    data: "id=" + id,
                    success: function(res) {
                        var element = res.data;
                        var text = "";
                        text += "<h3>" + element.name + "</h3>";
                        text += "<ul class='menu'>";
                        var posts = element.listPost;
                        for (var y in posts) {
                            var Class = "";
                            if (posts[y].id == postId) {
                                Class = "class='hightlight'";
                            }
                            text += "<li><a " + Class + "  href='index?goto=categories&id=" + id + "&postID=" + posts[y].id + "'>" + posts[y].name + "</a></li>";
                        }
                        text += "</ul>";
                        $('div.col-l-in').html(text);
                    },
                });
                $(document).ajaxComplete(function() {
                    var pre = $('a.hightlight').parent().prev().children().clone();
                    var next = $('a.hightlight').parent().next().children().clone();
                    pre.text("Trang trước").addClass("trang_t").addClass("tran_common");
                    next.text("Trang sau").addClass("trang_s").addClass("tran_common");
                    $('#footer_content').append(pre);
                    $('#footer_content').append(next);
                });
            });</script>
        <link rel="shortcut icon" href="http://www.mantisatemplates.com/template-preview/various/math/favicon.ico" type="image/x-icon">
        <style type="text/css"></style></head>

    <body id="top">
        <div id="wrapper">

            <%@ include file="header.jsp" %>

            <hr class="noscreen">

            <div id="skip-menu"></div>
            <div class="page">
                <div class="col-r">
                    <div class="col-r-in">
                        <h2>Lời Nói Đầu</h2>
                        <p>Praesent pharetra, risus non vehicula rutrum, elit dui tincidunt felis, eu iaculis urna dolor non purus. Praesent eget orci. 
                            Praesent aliquet. Vestibulum ante <a href="http://www.mantisatemplates.com/template-preview/various/math/index.html#">ipsum primis</a> in faucibus orci luctus et ultrices posuere cubilia Curae; Nulla purus. 
                            Nullam quam enim, congue tempor, gravida id, suscipit eget, magna. Donec urna. Aliquam est purus, condimentum nec, rutrum ac, vulputate sit amet, justo. 
                            Etiam dui. Nam vulputate. Maecenas placerat ultricies massa. Nam nisi. Nullam dignissim, odio dignissim accumsan fermentum, sapien magna porttitor orci, 
                            non lacinia elit pede id dui. Sed sit amet massa vitae tellus adipiscing laoreet.</p>

                        <hr class="noscreen">
                        <br>

                        
                        <hr class="noscreen">
                        <br>

                        <h3><span>Newest photos</span></h3>
                        <div class="gallery">
                            <a href="http://www.mantisatemplates.com/template-preview/various/math/index.html#"><img src="ressorces/image.jpg" alt="" width="120" height="90"></a>
                            <a href="http://www.mantisatemplates.com/template-preview/various/math/index.html#"><img src="ressorces/image.jpg" alt="" width="120" height="90"></a>
                            <a href="http://www.mantisatemplates.com/template-preview/various/math/index.html#"><img src="ressorces/image.jpg" alt="" width="120" height="90"></a>
                            <a href="http://www.mantisatemplates.com/template-preview/various/math/index.html#"><img src="ressorces/image.jpg" alt="" width="120" height="90"></a>
                        </div>

                    </div>
                </div> <!-- Right column end -->

                <hr class="noscreen">

                <div class="col-l">
                    <div class="col-l-in">
                        <br>

                    </div>
                    <script type="text/javascript">
                    </script>
                </div> <!-- Left column end -->

                <div class="cleaner">&nbsp;</div>

            </div> <!-- Page end -->

            <div id="footer">
                <ul>
                    <li><a href="">Home</a>|</li>
                    <li><a href="http://www.mantisatemplates.com/template-preview/various/math/index.html#">About</a>|</li>
                    <li><a href="http://www.mantisatemplates.com/template-preview/various/math/index.html#">Gallery</a>|</li>
                    <li><a href="http://www.mantisatemplates.com/template-preview/various/math/index.html#">Contact</a></li>
                </ul>

                <p><a href="http://www.mantisatemplates.com/template-preview/various/math/index.html#" onclick="print();" title="Javascript needed for a Print">Print</a> | <a href="http://www.mantisatemplates.com/template-preview/various/math/index.html#top">Top</a>?</p>
            </div> <!-- Footer end -->

        </div> <!-- Wrapper end -->

        <p id="backlinks"><a href="http://www.pestujemeweb.cz/">P?stujeme web</a> | visit: <a href="http://www.junglegym.cz/" title="Skluzavky Jungle Gym">Skluzavky</a></p>


    </body></html>